import httpAxios from "@/service/httpAxios";

// 登录：/user/login 参数：phone,password 请求方式：post
export const login = (params) => httpAxios.post("/user/login", params);

// 获取首页轮播：/home/banner 参数：无 请求方式：get
export const swiper = () => httpAxios.get('/home/banner')

// 获取首页商品：/home/shop 参数 pageid(当前的页码数),limit(一页多少条)（可选） 请求方式：get
export const homelist = () => httpAxios.get('/home/shop')

// 获取分类页面所有分类:/shop/shopType 参数：无 请求方式：get
export const menulist = () => httpAxios.get('/shop/shopType')

// 筛选商品接口：/shop/selectType 参数：type_id,category_id 请求方式：get
export const selectType = (params) => httpAxios.get('/shop/selectType', { params })

// 获取用户信息：/user/getUserInfo 参数：无 请求方式：get
export const getUserInfo = () => httpAxios.get('/user/getUserInfo')

// 添加购物车：/car/addCar 参数：user_id,shop_id 请求方式：post
export const addCar = (params) => httpAxios.post('/car/addCar', params)

// 获取购物车：/car/getCar 参数：user_id 请求方式：get
export const getCar = (params) => httpAxios.get('/car/getCar', { params})

// 删除购物车： /car/removeCar 参数： shop_id, user_id 请求方式：post
export const removeCar = (params) => httpAxios.post('/car/removeCar', params)